// --------------------数据回填，所有数据全部回填
function rederUser() {
    $.ajax({
        url: '/my/user/userinfo',
        success: function (res) {
            let form = layui.form;
            form.val('user', res.data);
        }
    });
}
rederUser();
//----------------------确认修改操作--------------
$('form').on('submit', function (e) {
    e.preventDefault();
    let data = $(this).serialize();
    $.ajax({
        type: 'POST',
        url: '/my/user/userinfo',
        data : data,
        success: function (res) {
            if (res.status === 0) {
                layer.msg(res.message);
                window.parent.getUserInfor();
            }
        }
    })
});


//---------------------重置----------------------
$('button[type=reset]').on('click', function (e) {
    e.preventDefault();
    rederUser();
})